<?php
/**
 * Ajax操作类
 * @author yaoli<yaoli@pateo.com.cn>
 * @version 1.0 GetUser add by yaoli<yaoli@pateo.com.cn> 
 */
class test extends ActionBase {
	
	private $date = null;
	
	function init() {
	
	}
	
	/**
	 * 动作
	 *
	 * @see AActionBase::action()
	 */
	public function action() {
		error_reporting(E_ALL);
		$json = get_url_content('http://map.sogou.com/lushu/lushu/getTrackJson/c8808035251312a60125149d703f0070');
		$json = get_url_content('http://map.sogou.com/lushu/lushu/getTrackJson/9a8080ac2180133001218137c6370346');
		#echo "<br>";echo "<br>";echo "<br>";echo "<br>";echo "<br>";
		 $json = iconv("GB2312//IGNORE", "UTF-8", str_replace("'", '"', $json));
		
		$arr = json_decode($json);
		
		 json_last_error();
		dump($arr);exit;
	}
	
	public function includetest(){
		echo "============================================================";
		include("saytest.php");
		echo "============================================================";
	}
	
	public function requiretest(){
		echo "============================================================";
		#if(1!=1){
			for($i=0;$i<10;$i++){
			echo $i;
		require("saytest.php");
			}
		#}
		echo "============================================================";
	}
	
	public function hash(){
		$size = pow(2, 16);
		 
		$startTime = microtime(true);
		$array = array();
		for ($key = 0, $maxKey = ($size - 1) * $size; $key <= $maxKey; $key += $size) {
			echo $key."<br>";
			exit;
			
			$array[$key] = 0;
		}
		
		
		exit;
		$endTime = microtime(true);
		echo '插入 ', $size, ' 个恶意的元素需要 ', $endTime - $startTime, ' 秒', "\n";
		 
		$startTime = microtime(true);
		$array = array();
		for ($key = 0, $maxKey = $size - 1; $key <= $maxKey; ++$key) {
			$array[$key] = 0;
		}
		$endTime = microtime(true);
		echo '插入 ', $size, ' 个普通元素需要 ', $endTime - $startTime, ' 秒', "\n";
	}
	
	public function phpinfo(){echo phpinfo();}
	
	
	

}